package org.lsp.view;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

import res.SysRes;

import com.alee.laf.WebLookAndFeel;

public abstract class GUI {
	private final static JFrame frame = new JFrame(SysRes.string(0));

	public static final void init() {
		SwingUtilities.invokeLater(new Runnable() {

			@Override
			public void run() {
				WebLookAndFeel.install();

				GUI.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

				// TODO GUI.frame.add(new GUIPanel(), BorderLayout.CENTER);

				GUI.frame.pack();

				GUI.frame.setIconImage(SysRes.image("appLogo").getImage());

				final Dimension screenSize = Toolkit.getDefaultToolkit()
						.getScreenSize();
				GUI.frame.setLocation(
						(screenSize.width - GUI.frame.getWidth()) / 2,
						(screenSize.height - GUI.frame.getHeight()) / 2);
				GUI.frame.setResizable(Boolean.FALSE);
				GUI.frame.setVisible(Boolean.TRUE);
			}
		});
	}
}
